package service

import (
	"context"
	"insighttracking/query/dao"
	"insighttracking/query/model"
)

type _supplierService struct {
}

func (s _supplierService) GetByNameApi(ctx context.Context, enterpriseId int64, supplier string) (*model.SupplierEntity, error) {
	return dao.SupplierEntity.WithContext(ctx).Where(
		dao.SupplierEntity.EnterpriseID.Eq(enterpriseId),
		dao.SupplierEntity.Name.Eq(supplier),
	).First()
}

var SupplierService = new(_supplierService)
